{extend name="../../base/view/common/base" /}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
	<h3 class="pb-3">功能菜单/节点</h3>
	<table class="layui-table layui-table-form">
		<tr>
			<td class="layui-td-gray-2">客户<font>*</font>
			</td>
			<td>
				<select name="purveyorId" lay-search>
					{volist name="punList" id="pl"}
					<option value="{$pl.id}" {if isset($detail.purveyorId)&&$detail.purveyorId == $pl.id} selected {/if}>{$pl.name}</option>
					{/volist}
				</select>
			</td>
			<td class="layui-td-gray">到期日期<font>*</font>
			</td>
			<td>
				<input type="text" name="endTime" id="orderDate" value="{$detail.endTime|default=''}" lay-verify="required" readonly autocomplete="off" placeholder="请输入"
					   lay-reqText="请输入" class="layui-input">
			</td>
			<td class="layui-td-gray">票号<font>*</font>
			</td>
			<td>
				<input type="text" name="ticketNum"  value="{$detail.ticketNum|default=''}" lay-verify="required"  autocomplete="off" placeholder="请输入"
					   lay-reqText="请输入" class="layui-input">
			</td>


		</tr>
		<tr>
			<td class="layui-td-gray">金额<font>*</font>
			</td>
			<td>
				<input type="text" name="honourMoney" value="{$detail.honourMoney|default=''}" lay-verify="required" autocomplete="off" placeholder="请输入"
					   lay-reqText="请输入" oninput="digitalFiltering(this,2)" class="layui-input">
			</td>
			<td class="layui-td-gray">承兑银行<font>*</font>
			<td>
				<input type="text" name="honourBank" value="{$detail.honourBank|default=''}" lay-verify="required" autocomplete="off" placeholder="请输入"
					   lay-reqText="请输入" class="layui-input">
			</td>

		</tr>

	</table>
	<div class="py-3">
		<input type="hidden" name="id" value="{$id}">
		{if !isset($detail.status)||$detail.status==1}
		<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">保存</button>
		<button type="reset" class="layui-btn layui-btn-primary">重置</button>
		{/if}
		{if isset($detail.status)&&$detail.status==1}
		<a href="javascript:" class="layui-btn layui-btn-normal" onclick="onSub()">确认</a>
		{/if}
	</div>
</form>
{/block}
<!-- /主体 -->

<!-- 脚本 -->
{block name="script"}
<script>
	const moduleInit = ['tool'];
	function gouguInit() {
		var form = layui.form,tool=layui.tool,level=0;


		//监听提交
		form.on('submit(webform)', function (data) {
			let callback = function (e) {
				layer.msg(e.msg);
				if (e.code == 0) {
					setTimeout(function(){
						parent.parent.location.reload();
					},1000);									
				}
			}
			tool.post("add", data.field, callback);
			return false;
		});
		layui.laydate.render({
			elem:"#orderDate"
		})


	}

</script>
{/block}
<!-- /脚本 -->